#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import experiment_blueprint
from api_1_0.experimentResource.experimentResource import ExperimentResource
from api_1_0.experimentResource.experimentOtherResource import ExperimentUpdateResource, ExperimentAddResource

api = Api(experiment_blueprint)

api.add_resource(ExperimentResource, '/experiment/<experiment_id>', '/experiment', endpoint='Experiment')


@experiment_blueprint.route('/experiment/update/<experiment_id>', methods=['PUT'], endpoint='ExperimentUpdate')
def update(experiment_id):
    return ExperimentUpdateResource.update(experiment_id)


# 发布实验
api.add_resource(ExperimentAddResource, '/experiment/add', endpoint='add_experiment')
